//
//  EBMBaseTabView.m
//  eBondMall
//
//  Created by 赵世杰 on 2020/4/1.
//  Copyright © 2020 zhaoshijie. All rights reserved.
//

#import "EBMBaseTabView.h"

@implementation EBMBaseTabView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if(self)
    {
        /// 初始化数据
        [self baseTabViewInitData];
    }
    return self;
}

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    /// 初始化数据
    [self baseTabViewInitData];
    
}


/// 初始化数据
- (void)baseTabViewInitData
{
    self.basePageIndex = 1;
    self.baseDataMArray = [[NSMutableArray alloc]init];
}



#pragma mark --------------方法--------------


/// 加载数据成功之后处理数据
/// @param isDown 是否下拉
- (void)loadRequestSuccessHandleDataWithIsDown:(BOOL)isDown
{
    if(isDown)
    {
        [self.baseDataMArray removeAllObjects];
        
        self.basePageIndex = 2;
        
    }
    else
    {
        self.basePageIndex ++;
    }
}




#pragma mark ----------UITableViewDelegate 代理方法----------

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 0.1)];
    headerView.backgroundColor = RGBCOLOR16_ffffff;
    
    
    return headerView;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.1;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 0.1)];
    footerView.backgroundColor = RGBCOLOR16_ffffff;
    
    return footerView;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.1;
}





@end
